package com.pe.pgn.clubpgn.domain;

import java.util.Calendar;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.Type;
import org.springframework.format.annotation.DateTimeFormat;



@Entity
@Table(name = "clpb_cliente_empresa")
public class ClpbClienteEmpresa extends CamposAuditoria {


	/**
	 * 
	 */
	private static final long serialVersionUID = -4273639777916432010L;
	private Long id;
	private String coRuc;
	private String deClienteEmpresa;
    private String deAlias;
    private String deEmailNotificacion1;
    private String deEmailNotificacion2;
    private boolean stClienteEmpresa;
    private boolean stRedTotal;
    private ClpdLineaCredito clpdLineaCredito;
    private List<ClprClienteEstacion> clienteEstaciones; 
    private List<ClpdTope> topes;
    private ClpdTope tope;
    
    
    @Id
    @Column(name="id")
    @SequenceGenerator(name="seqclienteempresa", sequenceName="seq_cliente_empresa")
    @GeneratedValue(generator="seqclienteempresa")    
	public Long getId() {
		return id;
	}

    @Column(name = "co_ruc", nullable = true, length = 11)
	public String getCoRuc() {
		return coRuc;
	}
    
    @Column(name = "de_cliente_empresa", nullable = true, length = 200)
	public String getDeClienteEmpresa() {
		return deClienteEmpresa;
	}

    @Column(name = "de_alias", nullable = false, length = 5)
	public String getDeAlias() {
		return deAlias;
	}

    @Column(name = "de_email_notificacion_1", nullable = true, length = 100)
	public String getDeEmailNotificacion1() {
		return deEmailNotificacion1;
	}
    
    @Column(name = "de_email_notificacion_2", nullable = true, length = 100)
	public String getDeEmailNotificacion2() {
		return deEmailNotificacion2;
	}

    @Column(name = "st_cliente_empresa", nullable = false)
	@Type(type = "yes_no")     
	public boolean isStClienteEmpresa() {
		return stClienteEmpresa;
	}
   
    @Column(name = "st_red_total")
	@Type(type = "yes_no")
	public boolean isStRedTotal() {
		return stRedTotal;
	}

	public void setStRedTotal(boolean stRedTotal) {
		this.stRedTotal = stRedTotal;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setCoRuc(String coRuc) {
		this.coRuc = coRuc;
	}

	public void setDeClienteEmpresa(String deClienteEmpresa) {
		this.deClienteEmpresa = deClienteEmpresa;
	}

	public void setDeAlias(String deAlias) {
		this.deAlias = deAlias;
	}

	public void setDeEmailNotificacion1(String deEmailNotificacion1) {
		this.deEmailNotificacion1 = deEmailNotificacion1;
	}

	public void setDeEmailNotificacion2(String deEmailNotificacion2) {
		this.deEmailNotificacion2 = deEmailNotificacion2;
	}

	public void setStClienteEmpresa(boolean stClienteEmpresa) {
		this.stClienteEmpresa = stClienteEmpresa;
	}

	@Transient
	public List<ClprClienteEstacion> getClienteEstaciones() {
		return clienteEstaciones;
	}

	public void setClienteEstaciones(List<ClprClienteEstacion> clienteEstaciones) {
		this.clienteEstaciones = clienteEstaciones;
	}

	@Transient
	public List<ClpdTope> getTopes() {
		return topes;
	}
	public void setTopes(List<ClpdTope> topes) {
		this.topes = topes;
	}
		
	@Transient
	public ClpdLineaCredito getClpdLineaCredito() {
		return clpdLineaCredito;
	}

	public void setClpdLineaCredito(ClpdLineaCredito clpdLineaCredito) {
		this.clpdLineaCredito = clpdLineaCredito;
	}

	
	@Transient
	public ClpdTope getTope() {
		return tope;
	}

	public void setTope(ClpdTope tope) {
		this.tope = tope;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Column(name = "co_usuario_creador", updatable = false, nullable = false, length = 30)
	public String getCoUsuarioCreador() {
		return coUsuarioCreador;
	}

    @Column(name = "da_fecha_creacion", updatable = false, nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
	public Calendar getDaFechaCreacion() {
		return daFechaCreacion;
	}

	@Column(name = "co_usuario_modificador", length = 30)
	public String getCoUsuarioModificador() {
		return coUsuarioModificador;
	}

    @Column(name = "da_fecha_modificacion")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
	public Calendar getDaFechaModificacion() {
		return daFechaModificacion;
	}       
	@Override
	public boolean equals(Object o) {
		return false;
	}

	@Override
	public int hashCode() {
		return 0;
	}

	@Override
	public String toString() {
		return   this.coRuc + ","  + this.deAlias + ","  + this.deClienteEmpresa
		+ ","  + this.deEmailNotificacion1 + ","  + this.deEmailNotificacion2;
	}
    
}
